import Vue from 'vue'
import Vuex from 'vuex'
import mutations from './mutations'
import getters from './getters'
import actions from './actions'
import moduleA from './modules/moduleA'

// 1.安裝插件
Vue.use(Vuex)

const state = {
  counter: 10,
  name: 'beiysd'
}

// 2.创建对象
const store = new Vuex.Store({
  // 数据
  state,
  // 方法
  mutations,

  // 计算属性
  getters,
  actions,
  modules: {
    a: moduleA
  }
})

// 3.导出store独享
export default store
